package zy.zy1;

import java.io.BufferedWriter;
import java.io.FileWriter;
import java.io.IOException;

public class Test {
    public static void main(String[] args) {
        int k = 0;
        for (int i = 2; i < 10000; i++) {
            boolean b = true;
            for (int j = 2; j < i; j++) {
                if (i % j == 0) {
                    b = false;
                    break;
                }
            }
            if (b) {
                try {
                    String str = Integer.toString(i);
                    BufferedWriter fs = new BufferedWriter(new FileWriter("C:\\Users\\admin\\Desktop\\新建文件夹\\新建文本文档.txt", true));
                    fs.write(str);
                    fs.write(0);
                    k++;
                    while (k == 10) {
                        fs.write(10);
                        k = 0;
                        break;
                    }
                    fs.close();
                } catch (IOException e) {
                    e.printStackTrace();
                } catch (Exception e) {
                    e.printStackTrace();
                }
            }
        }


    }
}
